package com.hst.capacity.infra.convertor;

import com.hst.capacity.domain.model.entity.driver.DriverExPlatformEntity;
import com.hst.capacity.domain.model.entity.order.express.ExpressOrderEntity;
import com.hst.capacity.domain.model.entity.order.intercity.IntercityDriverTaskEntity;
import com.hst.capacity.domain.model.entity.order.intercity.IntercityOrderEntity;
import com.hst.capacity.domain.model.entity.order.job.JobPlatformEntity;
import com.hst.capacity.domain.model.entity.order.pool.OrderPoolEntity;
import com.hst.capacity.domain.model.entity.setting.line.CityLineEntity;
import com.hst.capacity.domain.model.entity.setting.line.IntercityLineEntity;
import com.hst.capacity.domain.model.entity.setting.station.StationEntity;
import com.hst.capacity.domain.model.response.dispatch.CityLineVO;
import com.hst.capacity.domain.model.response.dispatch.LineVO;
import com.hst.capacity.domain.model.response.dispatch.StationVO;
import com.hst.capacity.domain.model.response.dispatch.TaskDetailVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 *  派单模块的POJO属性转换器
 *
 * @author jin
 * */
@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface DispatchConvertor {
    DispatchConvertor INSTANCE = Mappers.getMapper(DispatchConvertor.class);

    StationVO convert(StationEntity entity);
    CityLineVO convert(CityLineEntity entity);
    @Mapping(target = "name", source = "intercityLineAlias")
    LineVO convert(IntercityLineEntity entity);

//    @Mapping(target = "seats", source = "seating")
    TaskDetailVO.Task  convertDriverTask(DriverExPlatformEntity taskEntity);

    TaskDetailVO.Task  convertDriverTask(IntercityDriverTaskEntity taskEntity);

    TaskDetailVO.Task  convertDriverTask(JobPlatformEntity taskEntity);

    List<TaskDetailVO.Order> convertDriverExOrderList(List<ExpressOrderEntity> content);
    List<TaskDetailVO.Order> convertDriverIcOrderList(List<IntercityOrderEntity> content);
    List<TaskDetailVO.Order> convertDriverSpOrderList(List<OrderPoolEntity> content);

}
